{% extends "documents/document_base.html" %}
{% load i18n %}
{% load staticfiles %}

{% block title %} {% trans "Explore Documents" %} - {{ block.super }} {% endblock %}

{% block body_class %}documents documents-list explore{% endblock %}

{% block body %}
  <div class="page-header">
    {% if not READ_ONLY_MODE %}
      <a href="{% url "document_upload" %}" class="btn btn-primary pull-right">{% trans "Upload Documents" %}</a>
    {% endif %}
    <h2>{% trans "Explore Documents" %}</h2>
  </div>
  {% with include_type_filter='true' %}
    {% with header='Document Type' %}
      {% with filter='doc_type__in' %}
        {% include "search/_search_content.html" %}
      {% endwith %}
    {% endwith %}
  {% endwith %}
{% endblock %}

{% block extra_script %}
{{ block.super }}
  <script type="text/javascript">
      {% if HAYSTACK_SEARCH %}
          SEARCH_URL = '{% url 'api_get_search' api_name='api' resource_name='documents'%}'
      {% else %}
          SEARCH_URL = '{% url 'api_dispatch_list' api_name='api' resource_name='documents' %}';
      {% endif %}
    FILTER_TYPE = 'document';
  </script>
  {% with include_spatial='true' %}
    {% include 'search/search_scripts.html' %}
  {% endwith %}
{% endblock extra_script %}
